home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / dark_brown_eyes.swf / scripts / __Packages / mx / styles / CSSTextStyles.as < prev    next >
Text File  |  2007-09-26  |  4KB  |  156 lines

  1. class mx.styles.CSSTextStyles
  2. {
  3.    function CSSTextStyles()
  4.    {
  5.    }
  6.    static function addTextStyles(o, bColor)
  7.    {
  8.       o.addProperty("textAlign",function()
  9.       {
  10.          return this._tf.align;
  11.       }
  12.       ,function(x)
  13.       {
  14.          if(this._tf == undefined)
  15.          {
  16.             this._tf = new TextFormat();
  17.          }
  18.          this._tf.align = x;
  19.       }
  20.       );
  21.       o.addProperty("fontWeight",function()
  22.       {
  23.          return this._tf.bold == undefined ? undefined : (!this._tf.bold ? "none" : "bold");
  24.       }
  25.       ,function(x)
  26.       {
  27.          if(this._tf == undefined)
  28.          {
  29.             this._tf = new TextFormat();
  30.          }
  31.          this._tf.bold = x == "bold";
  32.       }
  33.       );
  34.       if(bColor)
  35.       {
  36.          o.addProperty("color",function()
  37.          {
  38.             return this._tf.color;
  39.          }
  40.          ,function(x)
  41.          {
  42.             if(this._tf == undefined)
  43.             {
  44.                this._tf = new TextFormat();
  45.             }
  46.             this._tf.color = x;
  47.          }
  48.          );
  49.       }
  50.       o.addProperty("fontFamily",function()
  51.       {
  52.          return this._tf.font;
  53.       }
  54.       ,function(x)
  55.       {
  56.          if(this._tf == undefined)
  57.          {
  58.             this._tf = new TextFormat();
  59.          }
  60.          this._tf.font = x;
  61.       }
  62.       );
  63.       o.addProperty("textIndent",function()
  64.       {
  65.          return this._tf.indent;
  66.       }
  67.       ,function(x)
  68.       {
  69.          if(this._tf == undefined)
  70.          {
  71.             this._tf = new TextFormat();
  72.          }
  73.          this._tf.indent = x;
  74.       }
  75.       );
  76.       o.addProperty("fontStyle",function()
  77.       {
  78.          return this._tf.italic == undefined ? undefined : (!this._tf.italic ? "none" : "italic");
  79.       }
  80.       ,function(x)
  81.       {
  82.          if(this._tf == undefined)
  83.          {
  84.             this._tf = new TextFormat();
  85.          }
  86.          this._tf.italic = x == "italic";
  87.       }
  88.       );
  89.       o.addProperty("marginLeft",function()
  90.       {
  91.          return this._tf.leftMargin;
  92.       }
  93.       ,function(x)
  94.       {
  95.          if(this._tf == undefined)
  96.          {
  97.             this._tf = new TextFormat();
  98.          }
  99.          this._tf.leftMargin = x;
  100.       }
  101.       );
  102.       o.addProperty("marginRight",function()
  103.       {
  104.          return this._tf.rightMargin;
  105.       }
  106.       ,function(x)
  107.       {
  108.          if(this._tf == undefined)
  109.          {
  110.             this._tf = new TextFormat();
  111.          }
  112.          this._tf.rightMargin = x;
  113.       }
  114.       );
  115.       o.addProperty("fontSize",function()
  116.       {
  117.          return this._tf.size;
  118.       }
  119.       ,function(x)
  120.       {
  121.          if(this._tf == undefined)
  122.          {
  123.             this._tf = new TextFormat();
  124.          }
  125.          this._tf.size = x;
  126.       }
  127.       );
  128.       o.addProperty("textDecoration",function()
  129.       {
  130.          return this._tf.underline == undefined ? undefined : (!this._tf.underline ? "none" : "underline");
  131.       }
  132.       ,function(x)
  133.       {
  134.          if(this._tf == undefined)
  135.          {
  136.             this._tf = new TextFormat();
  137.          }
  138.          this._tf.underline = x == "underline";
  139.       }
  140.       );
  141.       o.addProperty("embedFonts",function()
  142.       {
  143.          return this._tf.embedFonts;
  144.       }
  145.       ,function(x)
  146.       {
  147.          if(this._tf == undefined)
  148.          {
  149.             this._tf = new TextFormat();
  150.          }
  151.          this._tf.embedFonts = x;
  152.       }
  153.       );
  154.    }
  155. }
  156.